package com.ktjy.ch06.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ktjy.ch06.entity.SysUser;
import com.ktjy.ch06.mapper.SysUserMapper;
import com.ktjy.ch06.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liuqiaomiao
 * @since 2024-02-22
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
    @Autowired
    SysUserMapper sysUserMapper;


    @Override
    public SysUser loginPlus(String usrName, String password) {
        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
                .eq(SysUser::getUsrName, usrName)
                .eq(SysUser::getUsrPassword, password);
        return getOne(queryWrapper);
    }

    @Override
    public List<SysUser> getList() {
        return sysUserMapper.getList();
    }
}
